#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<vector<int>> vv(31, vector<int>(31, 0));

    vv[0][0] = 1;
    for (int i = 1; i < vv.size(); i++)
        for (int j = 1; j < vv[i].size(); j++)
            vv[i][j] = vv[i - 1][j] + vv[i - 1][j - 1];

    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= i; j++)
        {
            printf("%5d", vv[i][j]);
        }
        cout << endl;
    }


    return 0;
}